using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
namespace aqualba.portal.cesta_dir
{
    public partial class cesta : System.Web.UI.UserControl
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (sf.cadena(Request["logout"]) != "")
                {
                    HttpContext.Current.Session["dcliente"] = null;
                    hplsalir.NavigateUrl = "../clientes_dir/login.aspx";
                    hplsalir.Text = "Identificarse";

                    hplcliente.Visible = false;
                    //   lblcliente.Text = "Cliente";
                }
                if (HttpContext.Current.Session["cesta"] != null)
                {
                    List<lineaspedidos> lista = new List<lineaspedidos>();
                    lista = (List<lineaspedidos>)HttpContext.Current.Session["cesta"];
                    int x = 0;
                    foreach (lineaspedidos art in lista)
                    {
                        x = x + art.cantidad;
                    }
                    lblnarticulos.Text = x.ToString();
                }
                if (HttpContext.Current.Session["dcliente"] != null)
                {
                    hplcliente.Text = clientes.getclientes(sf.entero(HttpContext.Current.Session["dcliente"])).nombre;
                    hplcliente.Visible = true;
                }
                else
                {
                    hplsalir.NavigateUrl = "../clientes_dir/login.aspx";
                    hplsalir.Text = "Identificarse";
                    hplsalir.NavigateUrl = "../clientes_dir/login.aspx";
                    hplsalir.Text = "Identificarse";
                    // lblcliente.Text = "Cliente";
                    hplcliente.Visible = false;
                }
            }



        }
    }
}